export default {
    //使命名可使用
    namespaced: true,
    //数据
    state: {
        menuData: [
            {
                path: "/main",
                name: "main",
                label: "首页",
                icon: "s-home",
                url: "/Main",
                position:'1'
            },
            {
                path: "/",
                label: "组件",
                icon: "menu",
                // url: "/Assembly",
                position:'2',
                children: [
                    {
                        path: "/assembly/editor",
                        name: "editor",
                        label: "富文本编辑器",
                        url: "/assembly/Editor",
                        position:'2-1',
                    },
                    {
                        path: "/assembly/UploadPictures",
                        name: "UploadPictures",
                        label: "上传头像",
                        url: "/assembly/UploadPictures",
                        position:'2-2',
                    }
                ]
            },
            {
                path: "/",
                label: "管理",
                icon: "tickets",
                position:'3',
                children: [
                    {
                        path: "/manage/user",
                        name: "userManage",
                        label: "用户管理",
                        url: "/manage/User",
                        position:'3-1',
                    },
                    {
                        path: "/manage/admin",
                        name: "adminManage",
                        label: "管理员管理",
                        url: "/manage/admin",
                        position:'3-2',
                    },
                    {
                        path: "/manage/shop",
                        name: "shopManage",
                        label: "商店管理",
                        url: "/manage/shop",
                        position:'3-3',
                    },
                    {
                        path: "/manage/discuss",
                        name: "discussManage",
                        label: "点评管理",
                        url: "/manage/discuss",
                        position:'3-4',
                    },
                    {
                        path: "/manage/checkShop",
                        name: "checkShopManage",
                        label: "审核管理",
                        url: "/manage/checkShop",
                        position:'3-5',
                    }
                ]
            },
            {
                path: "/",
                label: "个人",
                icon: "user",
                position:'4',
                children: [
                    {
                        path: "/person/center",
                        name: "center",
                        label: "个人中心",
                        url: "/person/Center",
                        position:'4-1',
                    },
                    {
                        path: "/person/settings",
                        name: "settings",
                        label: "个人设置",
                        url: "/person/Settings",
                        position:'4-2',
                    },
                ]
            },
            {
                path: "/",
                label: "异常",
                icon: "warning-outline",
                position:'6',
                children: [
                    {
                        path: "/403",
                        name: "403",
                        label: "403",
                        url: "/403",
                        position:'6-1',
                    },
                    {
                        path: "/404",
                        name: "404",
                        label: "404",
                        url: "/404",
                        position:'6-2',
                    },
                    {
                        path: "/500",
                        name: "500",
                        label: "500",
                        url: "/500",
                        position:'6-3',
                    },
                ]
            },
            // {

            // },
            {
                path: "/",
                label: "其他",
                icon: "s-grid",
                position:'5',
                children: [
                    {
                        path: "/other",
                        name: "other",
                        label: "页面1",
                        url: "Other",
                        position:'5-1',
                    },
                    {
                        path: "/page1",
                        name: "page1",
                        label: "页面2",
                        url: "Page1",
                        position:'5-2',
                    },
                ]
            }
        ],
        isCollapse:false,
    },
    //逻辑
    mutations: {
        EidtIsCollapse(state)
        {   
            state.isCollapse = !state.isCollapse
        },
        /**
         * Menu刷新定位问题
         * @param {*} state 
         * @param {*} val 
         */
        EditPosition(state,val)
        {
            //临时保存页面定位，刷新时定位到刷新前的Menu,
            sessionStorage.setItem("MenuPosition",this.$route.position)
        },
        // EditTempMenuPositon(state,val)
        // {
        //     console.log(val);
        // }
    },
    // 操作数据
    actions: {

    },
}